﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;

namespace Canteen.Core.Common
{
    public static class WechatSetup
    {
        public static void AddWechatSetup(this IServiceCollection services, IConfiguration configuration)
        {
            if (services == null) throw new ArgumentNullException(nameof(services));
            services.Configure<WechatGzhOptions>(configuration.GetSection(WechatGzhOptions.Configure));
            services.AddHttpClient<IWechat, Wechat>();
        }
    }
}